<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/23
 * Time: 21:27
 */

namespace app\api\model;
use think\Model;

class User extends Model
{
    public function isExistOpenid($openid = '')
    {
       return self::where(['openid' => $openid]) -> find();
    }
    //关联address表，获取address表的信息
    public function address()
    {
        return $this -> hasOne('UserAddress', 'user_id', 'id');
    }
}